<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8" import="java.lang.*" buffer="128kb"%>
<%@ include file="/pages/safeai/jsp/common/taglibs.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta
	http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>我的订单</title>

<link href="${ctx}/css/style.css" rel="stylesheet" type="text/css" /> <link
	type="text/css" rel="StyleSheet" media="all" href="../css/combined.css">
    <style type="text/css">
	<!--
		.user_td1{
		line-height:30px;text-overflow : ellipsis ;white-space : nowrap ;overflow:hidden;border-bottom:1px dashed #ddd;
		}
	-->
	</style>
<link type="text/css" rel="StyleSheet" media="all"
	href="../css/global.css"> <script type="text/javascript"
	src="../js/calendar.js"></script> <script type="text/javascript"
	src="../js/calendar-zh.js"></script> <script type="text/javascript"
	src="../js/calendar-setup.js"></script> <script language="JavaScript"
	src="${ctx}/js/jquery.js"></script> <script language="JavaScript"
	src="${ctx}/js/filter.js"></script> <script language="JavaScript"
	src="${ctx}/js/json2.js"></script> <script type="text/javascript">
            // Hack to avoid bug in jscalendar - JRA-7713
            if (!Calendar._TT["WEEKEND"]) Calendar._TT["WEEKEND"] = "0,6";
            if (!Calendar._TT["DAY_FIRST"]) Calendar._TT["DAY_FIRST"] = "Display %s first";
            
			function check1(){
				var af = document.getElementById('created:after').value ;
				var bf = document.getElementById('created:before').value ;
				if(af.length<1 || bf.length <1){
					alert('时间选择不能为空!');
					return ;
				}
				var afa = af.split('/');
				var bfa = bf.split('/');
				var b = false;
				for(var i=0;i<afa.length;i++){
					if(afa[i] -0 -(bfa[i]-0) <0) b = true;
				}
				if(afa == bfa) b = true ;
				if(!b){
					alert('开始时间不能晚于结束时间!');
					return ;
				}
				
				var form = document.getElementsByTagName("form")[1];
				form.submit();
			} 
			
			function gotoPage(pageOffset, pageSize){
				var form = document.getElementsByTagName("form")[1];
				form.elements["pager.offset"].value = pageOffset;
				form.elements["pageSize"].value = pageSize;
				form.submit();
			}
			function quxiao(pd1,pd2){
				if(pd1==6||pd2==3){
					alert("已发货和已完成的订单不能取消");
					return false;
				}
			}
        </script></head> <body> <div class="bg"> <div class="bg_inside">
    
<div class="head"> 
	<c:import url="/pages/safeai/jsp/shop/header.jsp"></c:import>
</div> 
<c:import url="/front/userinfo.do?method=myRayi"></c:import>

 
<form action="${ctx}/front/userinfo.do?method=queryMemberOrder" method="post"
	name="userInfoForm"> <div class="user_order_content"> <div
	class="user_order_content_top"><img
	src="../images/user_order_content_top.jpg" /></div> <div
	class="user_order_content_center"> <ul> <li
	style=" background-image:url(../images/title_letter_icon.jpg); background-position:left center; background-repeat:no-repeat;padding:5px 0px 0px 15px;margin-bottom:5px;line-height:15px;color:#5a3e2e">我的订单</li>
<li>收 货 人： <label> <input type="text"
	name="orderIndex.consignee" /> </label> </li> <li>下单时间： <input
	name="orderIndex.adddate1" id="created:after" value="" type="text"
	/ style="background-image:url(../images/cal.gif); background-repeat:no-repeat; background-position:left;padding-left:25px; cursor:hand;width:176px">
<script type="text/javascript">
    Calendar.setup({

        firstDay       :    0,                  // first day of the week
        inputField     :    "created:after",     // id of the input field
        button         :    "created:after_trigger_c",  // trigger for the calendar (button ID)
        align          :    "Bl",           // alignment (defaults to "Bl")
        singleClick    :    true,
             ifFormat       : "%y/%m/%d"      // our date only format
         });
                       </script> —— <input name="orderIndex.adddate2"
	id="created:before" value="" type="text"
	/  style="background-image:url(../images/cal.gif); background-repeat:no-repeat; background-position:left;padding-left:25px; cursor:hand;width:176px">
<script type="text/javascript">
    Calendar.setup({

        firstDay       :    0,                  // first day of the week
        inputField     :    "created:before",     // id of the input field
        button         :    "created:before_trigger_c",  // trigger for the calendar (button ID)
        align          :    "Bl",           // alignment (defaults to "Bl")
        singleClick    :    true,
             ifFormat       : "%y/%m/%d"      // our date only format
         });
                       </script><a href="#" class="inquiry_manu"
	onclick="check1();">查询</a></li> </ul> <ul> <logic:notEmpty
	name="UserOrderRange" property="records">
	<li>
	<table width="662px" border="0" cellpadding="0" cellspacing="0">
		<tr style="color:#A6957C; background-color:#efefef">
			<td width="60px" class="user_td1" align="center">订单号</td>
			<td width="54px" class="user_td1" align="center">收货人</td>
			<td width="86px" class="user_td1" align="center">付款方式</td>
			<td width="78px" class="user_td1" align="center">订单总金额</td>
			<td width="95px" class="user_td1" align="center">订单状态</td>
			<td width="140px" class="user_td1" align="center">下单日期</td>
			<td width="62px" class="user_td1" align="center">操作</td>
			<td class="user_td1" align="center">查看订单</td>
		</tr>
		<logic:iterate id="order" name="UserOrderRange" property="records">
		<bean:define id="payanddeliver" name="order" property="payanddeliver"></bean:define>
			<bean:define id="status" name="order" property="status"></bean:define>
			<bean:define id="paystatus" name="order" property="paystatus"></bean:define>
			<bean:define id="deliverstatus" name="order" property="deliverstatus"></bean:define>
		<tr style="color:#888888;">
			<td width="60px" align="center" class="user_td1">${order.id}</td>
			<td width="54px" class="user_td1" align="center">${order.consignee}</td>
			<td width="86px" class="user_td1" align="center">${order.paymenttype}</td>
			<td width="78px" class="user_td1" align="center">${order.needpay}</td>
			<td width="95px" class="user_td1" align="center">
			<logic:equal
			name="order" property="status" value="3">
			<bean:message key="myorder.as.${order.status}" />
			&nbsp;
		</logic:equal> 
		<logic:notEqual name="order" property="status" value="3">
			<%java.lang.String str = com.safeai.util.StatusJudgeUtil.getInstance().getStatus((Integer)payanddeliver,(Integer)status,(Integer)paystatus,(Integer)deliverstatus); %>
			<%=str%>
		</logic:notEqual>
		</td>
		<td width="140px" class="user_td1" align="center" nowrap="nowrap"><bean:write name="order"
		property="adddate" format="yyyy-MM-dd" /></td>
		<td width="62px" class="user_td1" align="center">
		<logic:equal name="order" property="payanddeliver" value="1">
			<%if(paystatus.equals(1)){ %>
				<logic:equal value="1" name="order" property="paymentid">
					<a href="${ctx}/zfbPay.do?method=createUrl&kuaiqian.orderId=${orderid}" target="_blank">支付</a>　
				</logic:equal>
				<logic:equal value="2" name="order" property="paymentid">
					<a href="${ctx}/kqPay.do?method=pay&kuaiqian.orderId=${orderid}" target="_blank">支付</a>　
				</logic:equal>
				<logic:equal value="3" name="order" property="paymentid">
					<a href="${ctx}/kqPay.do?method=pay&kuaiqian.orderId=${orderid}" target="_blank">支付</a>　
				</logic:equal>
				<logic:equal value="4" name="order" property="paymentid">
					支付
				</logic:equal>
				<logic:equal value="5" name="order" property="paymentid">
					支付
				</logic:equal>
				<logic:equal value="6" name="order" property="paymentid">
					支付
				</logic:equal>
				<logic:equal value="7" name="order" property="paymentid">
					支付
				</logic:equal>
				<%-- <span><a href="#" onclick="location.href='${ctx}/front/userinfo.do?method=cancelOrder&orderIndex.id=${order.id}'" ></a></span> --%>
			<%}else{ %>
				<span>支付</span>
			<%} %>
		</logic:equal> 
		<logic:notEqual name="order" property="payanddeliver" value="1">
			<%-- <%if(deliverstatus.equals(4) || deliverstatus.equals(3) || status.equals(6) || status.equals(3) || status.equals(4) || status.equals(5)){ %> --%>
				<span>支付</span>
			<%-- <%}else{ %>
				<span><a href="#" onclick="if(confirm('是否取消')==true) location.href='${ctx}/front/userinfo.do?method=cancelOrder&orderIndex.id=${order.id}'">取消</a></span>
			<%} %> --%>
		</logic:notEqual> 
		<%-- <logic:equal name="order" property="payanddeliver" value="3">
			<span>3<a href="#" onclick="if(confirm('是否取消')==true) location.href='${ctx}/front/userinfo.do?method=cancelOrder&orderIndex.id=${order.id}'">取消</a></span>
		</logic:equal> 
		 --%>
			
			</td>
			<td class="user_td1" align="center"><a
			href="${ctx}/order/OrderDetailManage.do?method=orderDetial&id=${order.id}"
			target="_blank">查看详情</a></td>
		</tr>
		</logic:iterate>
	</table>
	</li>
</logic:notEmpty> 
<li style="float:right;text-align:right;padding-right:30px;margin-top:20px;width:400px"><%@ include file="/user/pageFront.jsp"%></li>
<li
	style="float:right;text-align:right;padding-right:30px;margin-top:10px;width:500px">截止
<bean:write name="orderDate" format="yyyy-MM-dd" /> 日，您共有 <font
	class="orange">${orderCount}</font> 张订单完成交易，累计消费 <font class="orange">${sumCount
}</font> 元</li> </ul> </div> <div class="user_order_content_bottom"><img
	src="../images/user_order_content_bottom.jpg" /></div> </div></div> </form> <%@ include
	file="/user/commonProblem.jsp"%> <div class="bottom">
	<%@ include file="/pages/safeai/jsp/shop/bottom.jsp"%>	
	<div class="clearAll"></div>
</div></body> </html>
